﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Entity;
using System.ComponentModel.DataAnnotations;

namespace NhaSolutions.ClientWeb.Models
{
    public class TabPageModel
    {
        [Key]
        public long TabID { get; set; }
        public long? TabParentID { get; set; }
        public string TabName { get; set; }        
        public string TabTitle { get; set; }
        public string TabDescription { get; set; }
        public string TabKeyword { get; set; }
        public bool? TabActive { get; set; }
        public int? TabPosition { get; set;}
        public string Tab1 { get; set; }
    }
    public class TabPageDBContext : DbContext
    {
        public DbSet<TabPageModel> TabPages { get; set; }
    }
    public class TabPageInitializer : DropCreateDatabaseIfModelChanges<TabPageDBContext>
    {
        protected override void Seed(TabPageDBContext context)
        {
            var movies = new List<TabPageModel> {  
  
                new TabPageModel { TabID = 1,   
                             TabName="Home",   
                             TabActive=true,  
                             TabPosition=1},
                new TabPageModel { TabID = 2,   
                             TabName="Contact",   
                             TabActive=true,  
                             TabPosition=2}
             };

            movies.ForEach(d => context.TabPages.Add(d));
        }
    }

}